// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.SearchableSnapshots;

public sealed partial class SearchableSnapshotsStatsRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// Return stats aggregated at cluster, index or shard level
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? Level { get => Q<Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel?>("level"); set => Q("level", value); }
}

/// <summary>
/// <para>
/// Retrieve shard-level statistics about searchable snapshots.
/// </para>
/// </summary>
public sealed partial class SearchableSnapshotsStatsRequest : PlainRequest<SearchableSnapshotsStatsRequestParameters>
{
	public SearchableSnapshotsStatsRequest()
	{
	}

	public SearchableSnapshotsStatsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "searchable_snapshots.stats";

	/// <summary>
	/// <para>
	/// Return stats aggregated at cluster, index or shard level
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? Level { get => Q<Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel?>("level"); set => Q("level", value); }
}

/// <summary>
/// <para>
/// Retrieve shard-level statistics about searchable snapshots.
/// </para>
/// </summary>
public sealed partial class SearchableSnapshotsStatsRequestDescriptor<TDocument> : RequestDescriptor<SearchableSnapshotsStatsRequestDescriptor<TDocument>, SearchableSnapshotsStatsRequestParameters>
{
	internal SearchableSnapshotsStatsRequestDescriptor(Action<SearchableSnapshotsStatsRequestDescriptor<TDocument>> configure) => configure.Invoke(this);

	public SearchableSnapshotsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
	{
	}

	public SearchableSnapshotsStatsRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "searchable_snapshots.stats";

	public SearchableSnapshotsStatsRequestDescriptor<TDocument> Level(Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? level) => Qs("level", level);

	public SearchableSnapshotsStatsRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.Indices? indices)
	{
		RouteValues.Optional("index", indices);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}

/// <summary>
/// <para>
/// Retrieve shard-level statistics about searchable snapshots.
/// </para>
/// </summary>
public sealed partial class SearchableSnapshotsStatsRequestDescriptor : RequestDescriptor<SearchableSnapshotsStatsRequestDescriptor, SearchableSnapshotsStatsRequestParameters>
{
	internal SearchableSnapshotsStatsRequestDescriptor(Action<SearchableSnapshotsStatsRequestDescriptor> configure) => configure.Invoke(this);

	public SearchableSnapshotsStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
	{
	}

	public SearchableSnapshotsStatsRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SearchableSnapshotsStats;

	protected override HttpMethod StaticHttpMethod => HttpMethod.GET;

	internal override bool SupportsBody => false;

	internal override string OperationName => "searchable_snapshots.stats";

	public SearchableSnapshotsStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? level) => Qs("level", level);

	public SearchableSnapshotsStatsRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices)
	{
		RouteValues.Optional("index", indices);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}